package com.yanming.demo.core.response;

import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;

@Data
public class RestResultBase {
    private int code;
    private String msg;
    private Object[] responseTime;

    private Object[] getResponseTime(){
        Date now=new Date();
        Object[] responseTime={now.getTime(),new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(now)};
        return responseTime;
    }

    public RestResultBase( int code,String msg){
        this.code=code;
        this.msg=msg;
        this.responseTime=responseTime;
    }

}
